/*
 * @Author: wzt 1602453034@qq.com
 * @Date: 2023-09-16 00:08:11
 * @LastEditors: wzt 1602453034@qq.com
 * @LastEditTime: 2023-09-16 16:31:42
 * @FilePath: \front_end\main\src\api\axios\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const BAST_URL= import.meta.env.VITE_BAST_URL;
import axios from 'axios'
const service =axios.create({ 
    baseURL:BAST_URL, 
    timeout:5000   // 设置超时时间
})

function XhrPOST(url:string,data?:any,options?:any){
    return service({
        method: 'POST',
        // headers:{},
        url,data,
        ...options
    })
}
function XhrGET(url:string,params?:any,options?:any){
    return service({
        method: 'POST',
        // headers:{},
        url,params,
        ...options
    })
}

export { XhrPOST,XhrGET }